package com.executor;

import java.util.Date;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
 * 单线程
 */
public class SingleThread {
    public static void main(String[] args) throws Exception{

        ExecutorService service2  = Executors.newSingleThreadExecutor();


            service2.submit(()->{


                System.out.println(new Date());

            });


        service2.shutdownNow();

    }
}
